package com.ttai.presenter.activity;

import android.app.Application;
import android.widget.Toast;

import com.google.gson.JsonObject;
import com.ttai.model.net.ResponseInfo;
import com.ttai.presenter.base.BasePresenter;
import com.ttai.ui.activity.ResetKey;

import retrofit2.Call;

public class VerifyKeyPresenter extends BasePresenter {
    ResetKey resetKey;

    public VerifyKeyPresenter(ResetKey resetKey) {
        this.resetKey = resetKey;
    }

    @Override
    protected void showError(String message) {
        Toast.makeText(resetKey,message,Toast.LENGTH_SHORT).show();

    }

    @Override
    protected void parseJson(JsonObject json) {
        Toast.makeText(resetKey,"验证成功",Toast.LENGTH_SHORT).show();
        resetKey.startButton();
    }
    public void verifyKey(String token,String key){
        Call<ResponseInfo> verifyKeyInfo = responseInfoApi.verifykey(token,key);
        verifyKeyInfo.enqueue(new CallBackAdapter());
    }
}
